1. Field of the Invention
The present invention relates to an image reading apparatus and an image forming apparatus. More specifically, the present invention relates to an image reading apparatus and an image forming apparatus that detect and remove a black line that appears in image data, when a plurality of documents, which are successively transmitted in a direction of vertical scanning, are read to generate the image data.
Priority is claimed on Japanese Patent Applications No. 2009-155229, filed Jun. 30, 2009, and No. 2009-155230, filed Jun. 30, 2009, the contents of which are incorporated herein by reference.
2. Description of the Related Art
An image reading apparatus, which is included in an image forming apparatus, reads a document at a reading position of a contact glass using a light source, a mirror, a lens, and so on to generate image data. If a foreign substance such as dust or shattered paper is attached to the contact glass, the mirror, the lens, and so on, then the image reading apparatus may read the document including the foreign substance and cause a black line in the image data.
It is not good for a user to have the black line in a printed paper and the like that the image data is printed on. Accordingly, the image reading apparatus that will not cause a black line is required. A method of detecting the black line that appears in the image data is used in some prior art.
In the prior art, the image reading apparatus reads densities of three lines, a front-end line of the document, a back-end line of the document, and a line between documents (a line between a document and next document), in a direction of reading the document (in a direction of horizontal scanning). Then, the image reading apparatus determines whether or not the image data has a black line.
An image reading unit of the image reading apparatus reads the densities of the three lines, the front-end line of the document, the back-end line of the document, and the line between documents. The image reading unit includes a sensor that detects the front-end line of the document and the back-end line of the document and outputs detection signals. The timings of reading the densities of three lines are controlled by the detection signals from the sensor. Various factors such as abilities of the sensor and a motor, which transmits the document, may cause a gap between the timings of reading the document (especially the back-end line).
First, the front-end line of the document is detected by the sensor. Then, reading of the document is started at a reading position at a predetermined time after the timing of detecting the front-end line of the document. The gap between the timing of detecting the front-end line of the document and the timing of reading the front-end line of the document can be reduced in part by adjusting the above predetermined time.
The document that is read may be irregular in size. Therefore, a method of detecting the front-end line of the document by the sensor and reading the document at the reading position of the back-end line at a predetermined time after the timing of detecting the front-end line of the document cannot be adopted. It is necessary to detect the back-end line of the document by the sensor and read the document at the reading position of the back-end line at the predetermined time after the timing of detecting the back-end line of the document.
If the back-end line of the document has passed through the reading position when the detection signal of the back-end line of the document from the sensor is received by the image reading unit, then the position of the document, which is at the reading position of the back-end line at the predetermined time after the timing of detecting the back-end line of the document, cannot be read. In this case, the gap between the timings of reading the back-end line of the document cannot be reduced by adjusting the predetermined time like the case of the front-end line of the document.
To solve this problem, a method of sampling all horizontal scanning lines (all data of one piece of document) that have been read is conceivable. However, this method requires a large memory and is not realistic.
In the prior art, if the black line is detected, then the reading position of the image reading apparatus is changed and the document is read again. Correcting the detected black line is not considered. However, a user may want the read image to be corrected instead of having the document read again.